def migrate(cr, version):
    # 删除与模型相关的数据
    cr.execute("DELETE FROM ir_model_data WHERE model = 'instruct.create.invoice.wiz';")
    cr.execute("DELETE FROM ir_attachment WHERE res_model = 'instruct.create.invoice.wiz';")
    cr.execute("DELETE FROM ir_ui_view WHERE model = 'instruct.create.invoice.wiz';")
    cr.execute("DELETE FROM ir_model WHERE model = 'instruct.create.invoice.wiz';")
    cr.execute("DELETE FROM ir_model_fields WHERE model_id IN (SELECT id FROM ir_model WHERE model = 'instruct.create.invoice.wiz');")
